package cn.edu.lzzy.mypractices.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.util.List;

@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "options")
public class Option extends BaseEntity {
    public String content;
    public String label;
    public boolean isAnswer;

    @ManyToOne
    public Question question;
    @ManyToMany
    public List<Result> results;

    @JsonIgnore
    public List<Result> getResults() {
        return results;
    }
}
